VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "IGameState"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Public Property Get PlayerJustMoved() As Long
'
End Property

'Create a deep clone of this game state.
Public Function Clone() As IGameState
'
End Function

'Update a state by carrying out the given move.
'Must update playerJustMoved.
Public Function DoMove(ByVal lpData As Long, ByVal nSize As Long) As Boolean
'
End Function

'Get all possible moves from this state.
'Used in MCTS only.
Public Function GetMoves(ByRef bData() As Byte, ByRef nSize As Long, ByVal bRespectRandomFactor As Boolean) As Long
'
End Function

'Used in MCTS only.
'should return valid move
'prefer winning move is better (?)
'nReversed means winning condition is reversed
Public Function GetRandomMoves(ByRef bData() As Byte, ByRef nSize As Long, ByVal bReversed As Boolean) As Boolean
'
End Function

'Get the game result from the viewpoint of playerjm.
'0=lose, 1=win, 2=draw, 3=not finished
Public Function GetResult(ByVal nPlayerJustMoved As Long) As Long
'
End Function

'Used in MCTS only.
'lpData: move data with size.
'return value: true=valid, false=invalid
Public Function FilterByRandomFactor(ByVal lpData As Long, ByVal nSize As Long) As Boolean
'
End Function

'////////user interface related

'return value: true means have next frame of animation
Public Function Draw(ByVal bm As cDIBSection, ByVal nWidth As Long, ByVal nHeight As Long) As Boolean
'
End Function

Public Sub ClearUserMoves()
'
End Sub

Public Function GetUserMoves(ByRef bData() As Byte, ByRef nSize As Long) As Boolean
'
End Function

'return value: 0=do nothing, 1=redraw, 2=confirm move
Public Function OnMouseDown(ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal Button As MouseButtonConstants, ByVal Shift As ShiftConstants) As Long
'
End Function

'return value: 0=do nothing, 1=redraw, 2=confirm move
Public Function OnMouseMove(ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal Button As MouseButtonConstants, ByVal Shift As ShiftConstants) As Long
'
End Function

'return value: 0=do nothing, 1=redraw, 2=confirm move
Public Function OnMouseUp(ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal Button As MouseButtonConstants, ByVal Shift As ShiftConstants) As Long
'
End Function

